<?php include("../resources/database/database.php"); ?>
<!DOCTYPE HTML>
<html>
	<head>
		<title>fortune</title>
		<link rel="stylesheet" type="text/css" href="resources/css/fortune.css" />
		<script type="text/javascript">
		function validate(form)
		{
			if(form.salutation.value=="default")
			{
				alert("Please select your salutation!");
				form.salutation.focus();
				return false;
			}
			else if(form.fname.value=="")
			{
				alert("Please enter your first name!");
				form.fname.focus();
				return false;
			}
			else if(form.mid.value=="")
			{
				alert("Please enter your middle initial!");
				form.mid.focus();
				return false;
			}
			else if(form.lname.value=="")
			{
				alert("Please enter your last name!");
				form.lname.focus();
				return false;
			}
			else if(form.grnder.value=="default")
			{
				alert("Please select your gender!");
				form.gender.focus();
				return false;
			}
			else if(form.contact.value=="")
			{
				alert("Please enter your contact number!");
				form.contact.focus();
				return false;
			}
			else if(!is_numeric(form.contact.value))
			{
				alert("Contact number must be numeric!");
				form.contact.focus();
				return false;
			}
			else if(form.email.value=="")
			{
				alert("Please enter your email address!");
				form.email.focus();
				return false;
			}
			else if(form.house.value=="")
			{
				alert("Please enter your house number!");
				form.house.focus();
				return false;
			}
			else if(form.street.value=="")
			{
				alert("Please enter your street name/number!");
				form.street.focus();
				return false;
			}
			else if(form.barangay.value=="")
			{
				alert("Please enter your barangay address!");
				form.barangay.focus();
				return false;
			}
			else if(form.town.value=="")
			{
				alert("Please enter your town address!");
				form.town.focus();
				return false;
			}
			else if(form.province.value=="")
			{
				alert("Please enter your province!");
				form.province.focus();
				return false;
			}
			else if(form.event.value=="default")
			{
				alert("Please select your event type!");
				form.event.focus();
				return false;
			}
			else if(form.number.value=="default")
			{
				alert("Please determine the number of persons involved!");
				form.number.focus();
				return false;
			}
			else if(form.month.value=="default")
			{
				alert("Please select month of event!");
				form.month.focus();
				return false;
			}
			else if(form.day.value=="default")
			{
				alert("Please select day of event!")
			}
			else
			{
				return true;
			}
		}
		</script>
	</head>

<body>

<div id="wrapper">
	<form id="form_reg" name="form_reg" method="pos[PPP';;;;;';''t" action="pages/register.php" onsubmit="return validate(form_reg);">
		<div id="title">FSR Reservation Form</div>
		<table>
			<tr>
				<td>Salutation:</td>
				<td>
					<select name="salutation">
					<?php $sal = array('Mister','Misis','Miss'); ?>
						<option value="default">--Select One--</option>
					<?php foreach($sal as $val) : ?>
						<option value="<?php echo $val; ?>"><?php echo $val; ?></option>
					<?php endforeach; ?>
					</select>
				</td>
			</tr>
			<tr>
				<td>Full Name:</td>
				<td>
					<input type="text" name="fname" id="fname" placeholder="First Name" />
					<input type="text" name="mid" id="mid" maxlength="1" size="1" placeholder="MI" />
					<input type="text" name="lname" id="lname" placeholder="Last Name" />
				</td>
			</tr>
			<tr>
				<td>Gender:</td>
				<td>
					<select name="gender">
					<?php $gender = array('Male','Female'); ?>
						<option value="default">--Select One--</option>
					<?php foreach($gender as $gen) : ?>
						<option value="<?php echo $gen; ?>"><?php echo $gen; ?></option>
					<?php endforeach; ?>
					</select>
				</td>
			</tr>
			<tr>
				<td>Contact Details:</td>
				<td>
					<input type="text" name="contact" id="contact" maxlength="11" placeholder="Contact Number" />
					<input type="text" name="email" id="email" placeholder="Email Address" />
				</td>
			</tr>
			<tr>
				<td>Street:</td>
				<td>
					<input type="text" name="house" id="house" placeholder="House Number" size="10" />
					<input type="text" name="street" id="street" placeholder="Street" size="10" />
					<input type="text" name="barangay" id="barangay" placeholder="Barangay" size="10" />
					<input type="text" name="town" id="town" placeholder="Town" size="10" />
					<input type="text" name="province" id="province" placeholder="Province" size="10" />
				</td>
			</tr>
			<tr>
				<td>Event Type:</td>
				<td>
					<select name="event">
					<?php $event = array('Birthday','Wedding','Banquet','Meeting','Seminar'); ?>
						<option value="default">--Select One--</option>
					<?php foreach($event as $val) : ?>
						<option value="<?php echo $val; ?>"><?php echo $val; ?></option>
					<?php endforeach; ?>
					</select>
				</td>
			</tr>
			<tr>
				<td>Number of Person:</td>
				<td>
					<select name="number">
					<?php for($i=1;$i<=300;$i++) : ?>
						<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
					<?php endfor; ?>
					</select>
				</td>
			</tr>
			<tr>
				<td>Event Date:</td>
				<td>
					<select name="month">
						<option value="default">--Month--</option>
					<?php for($i=1;$i<=12;$i++) : ?>
						<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
					<?php endfor; ?>
					</select>
					:
					<select name="day">
						<option value="default">--Day--</option>
					<?php for($i=1;$i<=31;$i++) : ?>
						<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
					<?php endfor; ?>
					</select>
					:
					<select name="year">
						<option value="default">--Year--</option>
					<?php for($i=2013;$i<=2099;$i++) : ?>
						<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
					<?php endfor; ?>
					</select>
				</td>
			</tr>
			<tr>
				<td></td>
				<td><input type="checkbox" name="agree" value="agree" />I Agree to terms and condition of Fortune.</td>
			</tr>
			<tr>
				<td></td>
				<td>
					<input type="submit" value="REGISTER" />
					<input type="reset" value="RESET" />
				</td>
			</tr>
		</table>
	</form>
</div>

</body>
</html>